<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>继承父类的全部属性和方法，构造自己成为新的类</h1>
<script>
    function People(name) {
        this._name=name;
    }
    People.prototype.see=function () {//prototype原型链
        alert("pre-hello"+this._name);
    }
    function Student(name) {
        this._name=name;
    }
    Student.prototype=new People();//首字母大写是类 首字母小写是对象，比如这里的People和Student是类，s supersee都是对象
    var supersee=Student.prototype.see;
    Student.prototype.see=function () {
        supersee.call(this);//不写这一项的话，People中pre-hello+this_name才能显示出来
        alert("stu-hello"+this._name);
    }
    var s=new Student("iwen");
    s.see();
</script>
</body>
</html>